<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Trang chủ</title>
<link rel="shortcut icon" href="../Images/Icons/SunstormLogo.gif" />
<link rel="stylesheet" href="../CSS/css_webnews.css"/>
<link href="../Menu_Zing/SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="../CSS/wt-rotator.css" rel="stylesheet" type="text/css" />
<link href="../CSS/slider.css" rel="stylesheet" type="text/css" />
<link href="../weather/weather.css" rel="stylesheet" type="text/css" />
<link href="../CSS/experiment.css" rel="stylesheet" type="text/css" />
 

<script src="../Menu_Zing/SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<script src="../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../Scripts/preview.js" type="text/javascript"></script>
<script src="../Scripts/jquery.wt-rotator.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/jquery-ui.min.js" ></script>
<script language="javascript" src="../weather/js/ajax.js"></script>
<script language="javascript" src="../Scripts/floater_xlib.js"></script>
<script language="javascript" src="../Scripts/Advertise_twoside.js"></script>
<script language="javascript" src="../Scripts/boxover.js"></script>
<script language="javascript" src="../Scripts/jquery.jqDock.min.js"></script>


<style> 

     </style> 
</head>

<body>
<?php 
include("../Connections/connect_client.php");
require_once("include/Advertise_twoside.php");

function getSubMenu($parent)
{
	$submenu='';
	$res=mysql_query("SELECT t.TopicID FROM topic t WHERE t.IsDeleted=0 and t.ParentID=$parent");
	while($t=mysql_fetch_assoc($res))
	{
		$submenu.='<'.$t["TopicID"].'>';
		$submenu.=getSubMenu(intval($t["TopicID"]));
	}
	return $submenu;
}
?>
<div id="main">
  <div class="header"></div>
  <div class="menu"><?php
  $urlAds="../Images/Advertisement/";
  $urlNews="../Images/Img_News/";
  $urlIcon="../Images/Icons/";
  require("../Menu_Zing/Zing/MenuNgang.php");
  require("include/JdockMenu.php");
  require("include/Feedback_modal.php");
  ?></div>
   <!----------------------------------------Bar Search + BreadCrumb------------------------------------------------------>
  <div class="searchBar" >
   <form action="SearchNews.php" method="get" id="frmQuicksearch">
    <div class="searchBox" >
        	<input type="text" placeholder="Tìm kiếm..." name="keyword"  />
            <input type="image" src="../Images/Icons/Knob Search.ico" onclick="form.frmQuicksearch.submit();"   />       
    </div>
  	</form>
  </div>
  <!----------------------------------------Content------------------------------------------------------>
  <!----------------------------------------Carousel Advertisement------------------------------------------------>
  <div class="left">
  	<div class="container" style="padding-bottom:10px">
    	<div class="wt-rotator">
            <a href="#"></a>            
            <div class="desc"></div>
            <div class="preloader"></div>
            <div class="c-panel">
                <div class="buttons">
                    <div class="prev-btn"></div>
                    <div class="play-btn"></div>    
                    <div class="next-btn"></div>               
                </div>
                <div class="thumbnails">
                    <ul>
                    <?php
					$advsql="SELECT a.AdvertiseName, a.Description, a.FileType, a.FilePath, a.Link FROM advertisement a WHERE a.IsDeleted=0 AND a.FileType=0 AND a.`Position`=7 ORDER BY a.CreatedDate DESC LIMIT 0,10";
					$resadv=mysql_query($advsql);
					while($row=mysql_fetch_assoc($resadv))
					{
					?>
                        <li>
                            <a href="<?php echo $urlAds.$row["FilePath"]; ?>" title="<?php echo $row["Link"]; ?>"></a>
                            <a href="<?php echo $row["Link"]; ?>" target="_blank"></a> 
                             <div style="left:4px; top:34px; width:306px;">  
                               <span class="cap-title"><?php echo $row["AdvertiseName"]; ?>̣</span><br/>
                               <?php echo $row["Description"]; ?>
                               </div>                         
                        </li>
                     <?php
					}?>
                        <!--<li>
                            <a href="../Images/Advertisement/highway.jpg" title="khoaphp@yahoo.com"></a>
                            <a href="http://nhatnghe.com/forum/showthread.php?t=90292" target="_blank"></a>                        
                            <div style="left:4px; top:34px; width:306px;">                            
                                <span class="cap-title">Hướng dẫn Đọc XML bằng Silverlight 4</span><br/>
                                Bài lab sau hướng dẫn bạn dùng Silverlight 4 đọc dữ liệu từ file XML, sử dụng Microsoft Expression Blend 4, chạy trên nền .NET Framework 4.</div>
                        </li>
                        <li>
                            <a href="../Images/Advertisement/up.jpg" title="khoaphp@yahoo.com"></a>
                            <a href="http://nhatnghe.com/forum/showthread.php?t=90048" target="_blank"></a>
                            <div style="left:4px; top:34px; width:306px;">                             
                                <span class="cap-title">Kích hoạt Webcam bằng Silverlight4</span><br/>
                                PHIM SAU HƯỚNG DẪN BẠN CÁCH KÍCH HOẠT WEBCAM
								BẰNG SILVERLIGHT 4
								CHẠY TRÊN NỀN ASP.NET 4</div>                              
                        </li>
                        <li>
                            <a href="../Images/Advertisement/walle.jpg" title="nhatnghe.com"></a>
                            <a href="http://nhatnghe.com/forum/showthread.php?t=89969" target="_blank"></a>
                            <div style="left:4px; top:34px; width:306px;">                            
                                <span class="cap-title">Kết hợp Silverlight 4 với SQL Server 2008</span><br/>
                                Phim + Lab hướng dẫn kết hợp Silverlight 4 với SQL Server 2008</div>                                                  	
                        </li>
                        <li>
                            <a href="../Images/Advertisement/triworks_abstract26.jpg" title="khoaphp@yahoo.com"></a>   
                            <a href="http://nhatnghe.com/forum/showthread.php?t=89170" target="_blank"></a>
                            <div style="left:4px; top:34px; width:306px;"> 
                               <span class="cap-title">Hướng dẫn tạo Flash Site cực kì kute</span><br/>
                               Bài lab sau hướng dẫn bạn tạo 1 Blog cá nhân với hiêu ứng flash cực kool - tương tự album online của Đông Nhi trên Zing.vn. </div>                                                          	                   
                        </li>
                        <li>
                            <a href="../Images/Advertisement/krazy-kartoons-robot-dj02.jpg" title="nhatnghe.com"></a>                  
                            <a href="http://nhatnghe.com/forum/showthread.php?t=52130" target="_blank"></a>
                            <div style="left:4px; top:34px; width:306px;"> 
                                <span class="cap-title">Phim + Source hướng dẫn làm website tin tức bằng JOOMLA 1.5</span><br/>
                                Bài lab sau hướng dẫn bạn thiết kế 1 website tin tức bằng JOOMLA 1.5 (Version mới nhất tính đến tháng 9-2009, version 1.5.14)</div>                                          	                          
                        </li>
                        <li>
                            <a href="../Images/Advertisement/sf.jpg" title="khoaphp@yahoo.com"></a>        
                            <a href="http://nhatnghe.com/forum/showthread.php?t=65507" target="_blank"></a>
                            <div style="left:4px; top:34px; width:306px;">  
                                <span class="cap-title">Hướng dẫn tạo website Thương mại điện tử bằng JOOMLA</span><br/>
                                Đối với các doanh nghiệp, nhu cầu thiết kế 1 website thương mại điện tử là không nhỏ. Hôm nay, tôi sẽ hướng dẫn bạn cách tạo ra 1 website thương mại điện tử bằng JOOMLA 1.5</div>                                                                     
                        </li>     
                        <li>
                            <a href="../Images/Advertisement/triworks_abstract17.jpg" title="nhatnghe.com"></a>                    
                            <a href="http://nhatnghe.com/forum/showthread.php?t=34299" target="_blank"></a>
                            <div style="left:4px; top:34px; width:306px;">  
                                <span class="cap-title">Phim+Source hướng dẫn làm website tin tức.[NHẤT NGHỆ ©]</span><br/>
                                Bài lab sau hướng dẫn các bạn làm 1 webiste tin tức.
Bài lab được mình quay phim và chia thành 11 bước, các bạn có thể thực hành step by step,
kể cả những bạn mới làm quen với Deveploer Toolbox. ̣
(Đây là 1 site ́đơn giản, không cầu kỳ, nhưng đủ các chức năng cơ bản cho mọi người tham khảo)</div>                             	                           
                        </li>     -->
                    </ul>
                </div>     
            </div>
        </div>
    
    
    </div>
  <!----------------------------------------------End Carousel------------------------------------------------------>
  
  <!----------------------------------------------Slider News----------------------------------------------------->
  	<script type="text/javascript">
	$(document).ready(function(){
		$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
	});
	</script>
  <div id="featured" >
		  <ul class="ui-tabs-nav">
          	<?php
			$topsql="SELECT n.NewsID,n.TopicID, n.Title, n.Description, n.Image,n.CreatedDate FROM news n WHERE n.IsDeleted=0 AND n.IsReview=1 ORDER BY n.CreatedDate DESC LIMIT 0,4 ";
			$restop=mysql_query($topsql);
			$arrtop=array();
			$i=0;
			while($top=mysql_fetch_assoc($restop))
			{
				$arrtop[$i]=array(
								  'NewsID'=>$top["NewsID"],
								  'Title'=>$top["Title"],
								  'Description'=>$top["Description"],
								  'Image'=>$top["Image"]
								  );
				$i++;
			}
			for($j=0;$j<count($arrtop);$j++)
			{
			?>
	        <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-<?php echo $j; ?>"><a href="#fragment-<?php echo $j; ?>"><img style="width:80px; height:50px" src="<?php echo $urlNews.$arrtop[$j]["Image"]; ?>" alt="" /><span><?php echo $arrtop[$j]["Title"]; ?></span></a></li>
            <?php
			}
			?>
	       <!-- <li class="ui-tabs-nav-item" id="nav-fragment-2"><a href="#fragment-2"><img src="../Images/Img_News/image2-small.jpg" alt="" /><span>20 Beautiful Long Exposure Photographs</span></a></li>
	        <li class="ui-tabs-nav-item" id="nav-fragment-3"><a href="#fragment-3"><img src="../Images/Img_News/image3-small.jpg" alt="" /><span>35 Amazing Logo Designs</span></a></li>
	        <li class="ui-tabs-nav-item" id="nav-fragment-4"><a href="#fragment-4"><img src="../Images/Img_News/image4-small.jpg" alt="" /><span>Create a Vintage Photograph in Photoshop</span></a></li> -->
	      </ul>

	    <?php
			for($j=0;$j<count($arrtop);$j++)
				{
					
		?>
	    <div id="fragment-<?php echo $j; ?>" class="ui-tabs-panel" style="">
			<img src="<?php echo $urlNews.$arrtop[$j]["Image"]; ?>" alt="" style="width:400px; height:250px" />
			 <div class="info" >
				<h2><a href="Detail.php?id=<?php echo $arrtop[$j]["NewsID"]; ?>" ><?php echo $arrtop[$j]["Title"]; ?></a></h2>
				<p><?php echo $arrtop[$j]["Description"]; ?></p>
			 </div>
	    </div>
		<?php
				}
		?>
	   
		</div>
  <!----------------------------------------------End Slider----------------------------------------------------->
  <!----------------------------------------------News----------------------------------------------------->
  <div id="content">
  <!--Tin 1--->
  <?php
  $topicsql="SELECT t.TopicID, t.TopicName, t.Description, t.Link, t.ParentID FROM topic t WHERE t.IsDeleted=0 AND t.IsAllowWriteNews=1 AND t.ParentID=0 ORDER BY t.OrderIndex  ";
  $restopic=mysql_query($topicsql);
  while($topics=mysql_fetch_assoc($restopic))
  {
	  $listTopic='<'.$topics["TopicID"].'>';
	  
  ?>
  <div class="div_topic">
    <div class="title_bar">
    <span><a href="GroupNews.php?topicID=<?php echo $topics["TopicID"];?>" title=""><?php echo $topics["TopicName"]; ?></a></span>
    <div class="childtopics">
    	<?php
		$childsql="SELECT t.TopicID, t.TopicName, t.Description, t.Link, t.ParentID FROM topic t WHERE t.IsDeleted=0 AND t.IsAllowWriteNews=1 AND t.ParentID=".intval($topics["TopicID"])." ORDER BY t.OrderIndex";
		$reschildtopic=mysql_query($childsql);
		$t=0;
		while($childtopic=mysql_fetch_assoc($reschildtopic))
		{
			if($t!=0) echo "|";
			$t++;
		?>
    	<a href="GroupNews.php?topicID=<?php echo $childtopic["TopicID"];?>" title=""><?php echo $childtopic["TopicName"]; ?></a>
        <?php
		}
  		?>
    </div>	
    </div>
    <div class="tp_content">
    <?php
		$listTopic='<'.$topics["TopicID"].'>'.getSubMenu(intval($topics["TopicID"]));
		$sqlnews="SELECT n.NewsID, n.NewsType, n.TopicID, n.Title, n.Description, n.Image, n.IsHot,n.CreatedDate FROM news n WHERE n.IsDeleted=0 AND n.IsReview=1 AND '$listTopic' LIKE CONCAT('%<',n.TopicID,'>%') ORDER BY n.CreatedDate DESC LIMIT 0,5 ";
		$resnews=mysql_query($sqlnews);
		$fnews=mysql_fetch_assoc($resnews);
	?>
    	<div class="top_news">
        	<a href="Detail.php?id=<?php echo $fnews["NewsID"]; ?>" title="">
            	<img src="<?php echo $urlNews.$fnews["Image"]; ?>" alt="" style="width:150px; margin:8px" />
            </a>
            <div style="width:230px; float:right">
            	<a href="Detail.php?id=<?php echo $fnews["NewsID"]; ?>" title="">
                <?php 
					echo $fnews["Title"];
					if($fnews["NewsType"]==1)
						echo "<img src='".$urlIcon."photo.gif' alt='' />";
					else if($fnews["NewsType"]==2)
						echo "<img src='".$urlIcon."video.gif' alt='' />";
					if($fnews["IsHot"]==1)
						echo "<img src='".$urlIcon."hot.gif' alt='' />";
				?> 
                </a>
                <br />
                <p><?php echo $fnews["Description"]; ?></p>
            </div>
        </div>
        <div class="list_news">
        	<ul>
            <?php
			while ($news=mysql_fetch_assoc($resnews))
			{
			?>
            	<li>
                	<a href="Detail.php?id=<?php echo $news["NewsID"]; ?>" 
                    title="header=[
		<?php echo $news["Title"]; ?>
	] 
	body=[
	      <div align='justify'>
		<img width='100' align='left' src='
			<?php echo $urlNews.$news["Image"]; ?>
		'>
 		<?php echo $news["Description"]; ?>
	</div>]
	"
                    >
					<?php 
                        echo $news["Title"];
                        if($news["NewsType"]==1)
                            echo "<img src='".$urlIcon."photo.gif' alt='' />";
                        else if($fnews["NewsType"]==2)
                            echo "<img src='".$urlIcon."video.gif' alt='' />";
                        if($fnews["IsHot"]==1)
                            echo "<img src='".$urlIcon."hot.gif' alt='' />";
                    ?> 
                    </a>
                </li>
                <!--<li><a href="#" title=""> Tin thứ hai </a><img src="../Images/Icons/new_icon_gif.gif" alt="" /></li>
                <li><a href="#" title=""> Tin thứ ba </a></li>
                <li><a href="#" title=""> Tin thứ tư Tin thứ nhất Tin thứ nhất Tin thứ nhất Tin thứ nhất Tin thứ nhất </a></li>-->
            <?php
			}
			?>
            </ul>
        </div>
        <div style="clear:both"></div>
    </div>
  </div>
  <?php
  }
  ?>
  
  <!----End--->
  </div>
<!----------------------------------------------End News----------------------------------------------------->
  </div>
  <div class="right">
  <!----------------------------------------------Weather+Stock----------------------------------------------------->
  	<div id="weather">
    <?php include("../weather/index.php"); ?>
    </div>
   <div id="stock">
    <?php include("include/stock.html"); ?>
    </div> 
   <!----------------------------------------Hot News----------------------------------------->
     <div id="hotnews">
     	<div class="title"></div>
        <div class="hot">
       	  <ul>
          <?php
		  $hotsql="SELECT n.NewsID, n.Title, n.Image FROM news n WHERE n.IsDeleted=0 AND n.IsReview=1 ORDER BY n.Views DESC LIMIT 0,5 ";
		  $reshot=mysql_query($hotsql);
		  while($hot=mysql_fetch_assoc($reshot))
		  {
		  ?>
            	<li> 
                	<img src="<?php echo $urlNews.$hot["Image"]; ?>" alt="" style="width:80px; height:50px" />
                    <a href="Detail.php?id=<?php echo $hot["NewsID"]; ?>"><?php echo $hot["Title"]; ?></a>
                </li>
          <?php
		  }
		  ?>
               <!-- <li>
                	<img src="../Images/Img_News/image1-small.jpg" alt="" />
                    <a href="#">Đây là tiêu đề tin nổi bật</a> 
                </li>
                <li>
                	<img src="../Images/Img_News/image1-small.jpg" alt="" />
                    <a href="#">Đây là tiêu đề tin nổi bật</a>
                </li>
                <li>
                	<img src="../Images/Img_News/image1-small.jpg" alt="" />
                    <a href="#">Đây là tiêu đề tin nổi bật</a>
                </li>
       		<li>
                	<img src="../Images/Img_News/image1-small.jpg" alt="" />
                    <a href="#">Đây là tiêu đề tin nổi bật</a>
            </li> -->
            </ul>
       </div>
    </div>
    <!-----------------------------------Vote---------------------------------------------->
    <div id="vote">
    	<div class="title"></div>
        <div class="hot">
        <form method="get" action="captcha/confirm.php" target="_blank">
        <?php
			$votesql="SELECT v.VoteID, v.VoteName, v.Content FROM vote v WHERE v.IsDeleted=0 AND v.IsEnd=0 ORDER BY v.CreatedDate desc LIMIT 0,1"; 
			$resvote=mysql_query($votesql);
			$vote=mysql_fetch_assoc($resvote);
			echo $vote["Content"];
			
		?>
            <ul>
            <?php
			$vdsql="SELECT v.VoteDetailID, v.Content FROM votedetail v WHERE v.VoteID=".intval($vote["VoteID"])." ORDER BY v.VoteDetailID";
			$resvd=mysql_query($vdsql);
			$k=0;
			while($dt=mysql_fetch_assoc($resvd))
			{
			?>
            	<li><label><input type="radio" name="answer" <?php if($k==0) echo "checked='checked'"; ?> value="<?php echo $dt["VoteDetailID"]; ?>"  /><?php echo $dt["Content"]; ?></label></li>
            <?php
			$k++;
			}
			?>
                <!--<li><label><input type="radio" name="answer" id="cauB" value="" />Đức</label></li>
                <li><label><input type="radio" name="answer" id="cauC" value="" />Pháp</label></li>
                <li><label><input type="radio" name="answer" id="cauD" value="" />Đội bóng khác</label></li> -->
            </ul>
            <?php
			if(mysql_num_rows($resvote)>0)
			{
			?>
            <a id="bieuquyet" target="_blank" href="include/StatisticResult.php?voteid=<?php echo $vote["VoteID"];  ?>">Thống kê</a>&nbsp;&nbsp;<input type="submit" value="Biểu quyết" />
            <?php
			}
			?>
          </form>
       </div>
    </div>
    
    <!-------------------------------------Advertisement-------------------------------------------->
    <div id="advertisement_right">
    	<div class="title"></div>
        <div class="hot">
       	  	
            <ul>
            <?php 
			$query="SELECT a.AdvertiseName, a.FileType, a.FilePath, a.Link FROM advertisement a WHERE a.`Position`=4 AND a.IsDeleted=0 ORDER BY a.CreatedDate desc limit 0,5";
			
			$adver=mysql_query($query);
			while($row=mysql_fetch_assoc($adver))
			{
			
			switch($row['FileType'])
			{
				case 0:
				?>
				 <li><a href="<?php echo $row['Link']; ?>"><img alt="" src="<?php echo $urlAds.$row['FilePath']; ?>"   /></a></li>
				<?php
				break;
				case 1:
				?>
					<object width="250"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
			<param value="quangcao/qc1.swf" name="movie">
			<param value="high" name="quality">
			<embed width="250"  type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" quality="high" src="<?php echo $urlAds.$row['FilePath']; ?>">
			</object>
				<?php
				break;
			}
		
			}
			
			?>
               <!-- <li><a href="#"><img src="../Images/Advertisement/qc2.gif" /></a></li>
                <li><a href="#"><img src="../Images/Advertisement/qc3.gif" /></a></li>
                <li><a href="#"><img src="../Images/Advertisement/qc4.gif" /></a></li> -->
          </ul>
           
       </div>
    </div>
  </div>

  
  
  <!------------------------------Footer--------------------------------------------------->
  <div class="footer">
  	<p>
    	Designed by: Nguyen Minh Nhat<br />
        Email: mimhnhat2110@gmail.com<br />
        Mobile: 0908311627
    </p>
  </div>
</div>

 
</body>
</html>